<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>分步表单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <link rel="stylesheet" href="../../js/lay-module/step-lay/step.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <div class="layui-fluid">
            <div class="layui-card">
                <div class="layui-card-body" style="padding-top: 40px;">
                    <div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
                        <div carousel-item>
                            <div>
                                <div class="layui-form" style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">总金额:</label>
                                        <div class="layui-input-block">
                                            <input id="total" type="text" class="layui-input" lay-verify="number" required />
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">需支付金额:</label>
                                        <div class="layui-input-block">
                                            <input id="payment" type="text" class="layui-input" lay-verify="number" required />
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">支付方式:</label>
                                        <div class="layui-input-block">
                                            <input type="radio" name="sex" value="现金" title="现金" checked="">
                                            <input type="radio" name="sex" value="银行卡" title="银行卡">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <button id="closeIframe" class="layui-btn" lay-submit lay-filter="formStep">
                                                结账
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    layui.use([ 'form', 'step','layer'], function () {
        var $ = layui.$,
            form = layui.form,
            step = layui.step,
            layer=layui.layer;

        step.render({
            elem: '#stepForm',
            filter: 'stepForm',
            width: '100%', //设置容器宽度
            stepWidth: '750px',
            height: '500px',
            stepItems: []
        });
        $.post(
            "/log/checkoutPayment",
            {},function (res) {
                $("#total").val(res.toFixed(2))
                let a=${param.reduced}*res
                $("#payment").val(a.toFixed(2))
            }
        )
        var vid=${param.vid}
        var index = parent.layer.getFrameIndex(window.name);
            $('#closeIframe').click(function(){
                $.post(
                    "/log/checkoutFinallyDel",{
                        vid:vid
                    },function () {
                        parent.layer.close(index);
                    }
                )

            });


    })
</script>
</body>
</html>